package com.yifeng.repo.micro.service.server.mps;

import feign.Param;
import feign.RequestLine;
import next.fire.mps.api.UserService;
import next.fire.mps.api.model.ContactWay;
import next.fire.mps.api.model.DateRange;
import next.fire.mps.api.model.User;
import next.fire.mps.api.model.UserBehaviorData;
import org.springframework.cloud.openfeign.FeignClient;

import java.util.List;

@FeignClient(name = "mpsUserServiceClient", url = "${yfcloud.micro.service.mps.url}", path = "/fire-mps")
public interface UserServiceClient extends UserService {

    @Override
    @RequestLine("POST /UserService/get")
    User get(@Param("merchantId") String merchantId, @Param("mpAppId") String mpAppId, @Param("openId") String openId);

    @Override
    @RequestLine("POST /UserService/listOpenId")
    List<String> listOpenId(@Param("merchantId") String merchantId, @Param("mpAppId") String mpAppId, @Param("offsetOpenId") String offsetOpenId,
                            @Param("pageSize") int pageSize);

    @Override
    @RequestLine("POST /UserService/listBehaviorData")
    List<UserBehaviorData> listBehaviorData(@Param("merchantId") String merchantId, @Param("mpAppId") String mpAppId, @Param("openIds") List<String> openIds,
                                            @Param("partyids") List<String> partyids, @Param("dateRange") DateRange dateRange);

    @Override
    @RequestLine("POST /UserService/createContactWay")
    ContactWay createContactWay(@Param("merchantId") String merchantId, @Param("mpAppId") String mpAppId, @Param("openIds") List<String> openIds,
                                @Param("qrCodeContact") boolean qrCodeContact, @Param("skipVerify") boolean skipVerify, @Param("state") String state);

    @Override
    @RequestLine("POST /UserService/updateContactWay")
    void updateContactWay(@Param("merchantId") String merchantId, @Param("mpAppId") String mpAppId, @Param("confId") String confId, @Param("skipVerify") boolean skipVerify);

    @Override
    @RequestLine("POST /UserService/deleteContactWay")
    void deleteContactWay(@Param("merchantId") String merchantId, @Param("mpAppId") String mpAppId, @Param("confId") String confId);
}
